<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>04 福</title>
    <style>
        #box1 {
            border: 1px solid red;
        }
    </style>
</head>

<body>
    <div class="box">
        <canvas id="box1" width="300" height="300"></canvas>
    </div>

    <script>
        //获取canvas元素
        var box1 = document.getElementById('box1');
    </script>
</body>

</html>